<template>
    <Modbus v-if="currentTab === 'modbus'"></Modbus>
    <Private v-else-if="currentTab && currentTab !== 'mqtt' && currentTab !== 'modbus'"></Private>
</template>
<script setup lang="ts">
import Private from './private/Index.vue';
import Modbus from './modbus/Index.vue';
const protocolDetail = inject<any>('protocolDetail');

const currentTab = ref();

watch(
    () => protocolDetail,
    newValue => {
        if (newValue && newValue.value.protocolPublic) currentTab.value = newValue.value.protocolPublic.protocolType;
    },
    {
        immediate: true,
        deep: true
    }
);
</script>
<style scoped lang="scss"></style>
